<?php
$lang_include = true;

if (isset($_GET["lang"]))
{
	$lang = $_GET["lang"];
	setcookie("lang", $lang);
}
else if (isset($_COOKIE["lang"]))
	$lang = $_COOKIE["lang"];
else $lang = "Eng";

if ($lang=="Rus") include "inc/lang.rus.php";
else 
{
	$lang = "Eng";
	include "inc/lang.eng.php";
}

if ($lang=="Rus")
{
	setlocale(LC_TIME, "ru_RU.utf8", "ru_RU.UTF8", "ru_RU.UTF-8","ru.utf8");
}

if ($cw2 == 1)
{
 if ($lang=="Rus")
 {
  include "CW2/cw2_lang.rus.php";
 }
 else 
 {
 	include "CW2/cw2_lang.eng.php";
 }
}

function lang_resource($resource)
{
	global $lang;
	if ($lang=="Rus")
	{
		if ($resource=="bt_download_up.gif")
			$resource = "download_bt_download_up.jpg";
		if ($resource=="bt_download_up_o.gif")
			$resource = "download_bt_download_up_o.jpg";
	}
	if ($lang=="Rus" && file_exists("pic_ru/".$resource))
		return "pic_ru/".$resource;
	return "pic/".$resource;
}

?>